import re
import sys

# 匹配不符合大驼峰规则的函数定义
FUNCTION_PATTERN = re.compile(r'\b([a-z_][a-zA-Z0-9_]*)\s*\([^)]*\)\s*{')

def check_function_naming(file_path):
    with open(file_path, 'r') as f:
        content = f.read()
        for match in FUNCTION_PATTERN.finditer(content):
            function_name = match.group(1)
            print(f"错误: 文件 {file_path} 中函数 '{function_name}' 不符合大驼峰命名规则")
            return 1
    return 0

if __name__ == '__main__':
    sys.exit(check_function_naming(sys.argv[1]))